﻿using System;
using Jayden.Dll.Web.Enums;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;
using Jayden.Dll.Web.HtmlControls.Interfaces;

namespace Jayden.Dll.Web.HtmlControls
{
	public class Video : HtmlElement, WithSrc, WithWidth, WithHeight, WithAutoPlay, WithControls, WithMuted, WithLoop
	{
		public Video() : base(VideoDescription.Instance) { }

		public string PreLoad { get { return this["preload"]; } set { this["preload"] = value; } }
		public string MediaGroup { get { return this["mediagroup"]; } set { this["mediagroup"] = value; } }
		public bool AutoPlay { get { return GetAttributeBool("autoplay"); } set { SetAttribute("autoplay", value); } }
		public bool Controls { get { return GetAttributeBool("controls"); } set { SetAttribute("controls", value); } }
		public bool Loop { get { return GetAttributeBool("loop"); } set { SetAttribute("loop", value); } }
		public bool Muted { get { return GetAttributeBool("muted"); } set { SetAttribute("muted", value); } }
		public string Src { get { return this["src"]; } set { this["src"] = value; } }
		public string Poster { get { return this["poster"]; } set { this["poster"] = value; } }
		public uint? Width { get { return GetAttributeUint("width"); } set { SetAttribute("width", value); } }
		public uint? Height { get { return GetAttributeUint("height"); } set { SetAttribute("height", value); } }
	}
	public class VideoDescription : HtmlElementDescription
	{
		public static readonly VideoDescription Instance = new VideoDescription();
		private VideoDescription() : base("video", HtmlVersion.Html5, true, true) { }
		public override Type ControlType { get { return typeof(Video); } }
		public override string Description { get { return "video or movie."; } }
	}
}
